This page last changed on Nov 17, 2005 by bowens.
Q: Ant - junit, build failed: Could not create task or type of type: junit
When running JUnit tasks in ant and you get the following error:
BUILD FAILED
path\to\Geoserver\build.xml:259: Could not create task or type of type: junit.
Ant could not find the task or a class this task relies upon.
To fix this problem, you need to copy a JUnit.jar file to your eclipse/plugins/org.apache.ant/lib directory
Next you need to go into Eclipse then click on Window->Preferences->ant->Runtime, then select 'Ant Home Entries (Default). Click on the button 'Add External JARs'. Locate the junit.jar file you copied, select it and hit 'OK'. Hit 'Apply', then 'OK' and try your ant task again. That should fix it.
This hint has been very heplful to me.
I had a similar problem, but with the scp-task. I had to place a copy of jsch.jar in the directory, then I could run the target containing the scp-task out of eclipse. Before I had to do it via command-line.

Posted by at Feb 03, 2006 09:18
|
I faced the same problem in Eclipse.The tip was very useful.

Posted by at Apr 20, 2006 06:11
|
I must agree. Excellent tip. Clear and concise.

Posted by at Apr 21, 2006 10:10
|
very helpful hint .. before that i was just trying by adding junit jar in plugin lib folder but i wasnt aware of that window -> prefrence linking procedure thanks buddy

Posted by at May 02, 2006 06:15
|
Also help me so much , thanks U.
Jan

Posted by at May 02, 2006 09:58
|
very helpful solution to resolve the problem. thanks

Posted by at May 12, 2006 08:55
|
I have the same problem with scp task for ant under eclipse. But the lib ant-jsch.jar already exists in the correct location (eclipse/plugins/org.apache.ant/lib directory)....
Simona

Posted by at May 24, 2006 04:57
|
That nailed it - Thanks!

Posted by at Jun 01, 2006 18:17
|
Hi,
My problem is odd, I can run my junit task without any problems on both Eclipse and command line, but not Linux box!
I got this error:
Could not create task or type of type: junit.
Please help! Best regards.
|
awesome Tip. worked like magic... thanks for the tip
|
|